﻿@model IEnumerable<GameSchoolApplication.Models.GameInstructor>
@{
    ViewBag.Title = "Óyfirfarin verkefni og próf";
    Layout = "~/Views/Shared/_TeacherLayout.cshtml";
}

<h2>Óyfirfarin verkefni og próf</h2>

@foreach(var instructor in Model)
{
    if (instructor.Game.UngradedTests.Count() > 0 || instructor.Game.UngradedAssignments.Count() > 0)
    {
        <h3>@instructor.Game.Title</h3>
        if (instructor.Game.UngradedAssignments.Count() > 0)
        {
            <h4>Verkefni</h4>
            foreach (var assignment in instructor.Game.UngradedAssignments)
            { 
            <p>@assignment.Student.Name:
            @Html.ActionLink(assignment.Assignment.Title, "Grade", "Assignment", new { handInId = assignment.Id }, new { })</p>
            }
        }
        if (instructor.Game.UngradedTests.Count() > 0)
        {
            <h4>Próf</h4>
            foreach (var test in instructor.Game.UngradedTests)
            { 
            <p>@test.Student.Name:
            @Html.ActionLink(test.Test.TestName, "Grade", "Test", new { handInId = test.Id }, new { })</p>
            }
        }
    }
}
